/*
 * JSON001Picture.java
 *
 * Created on 6 październik 2007, 20:28
 */

package kosciak.blip4j.api.json001;

import kosciak.blip4j.Picture;

import java.net.MalformedURLException;
import java.net.URL;

import org.json.JSONObject;
import org.json.JSONException;

/**
 *
 * @author Wojtek 'KosciaK' Pietrzok
 */
class JSON001Picture extends Picture{
    
    /**
     * Creates a new instance of JSON001Picture
     */
    private JSON001Picture(int id, URL url){
        super(id, url);
    }
 
    static Picture getInstance(JSONObject obj) throws JSONException, MalformedURLException {
        return new JSON001Picture(obj.getInt("id"), new URL(obj.getString("url")));
    }

}
